import os
import uiautomation
from config.config import DATA_PATH
from page.index import IndexPage
from page.医技管理.yijizhixing__page import yijizhixing
from page.收费管理.huajiashoufei__page import huajiashoufei
from tools.sjqd_way import read_data_from_excel
class Tiaoshi():
    his = uiautomation.WindowControl(searchDepth=1, Name='科玛奇医院信息管理系统')  # 锁定窗口
    his.SetFocus()
    def quxiaoyijizhixing(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "测试患者")
        name = self.data[0][0]
        ap = IndexPage()
        ap.click_yjgl_btn()#点击医技管理
        ap.click_yjzx_btn()#点击医技执行按钮
        bp = yijizhixing()
        bp.choose_yizhixing()  # 选择已执行
        bp.click_quanbukeshi_btn()#点击全部科室
        bp.input_name(name)#输入姓名
        bp.click_chaxun_btn()#点击查询按钮
        bp.choose_hz1()#选择患者1
        bp.click_quxiaozhixing_btn()#点击取消执行
        bp.click_qxzxyes_btn()#点击确定按钮
if __name__ == '__main__':
    Tiaoshi().quxiaoyijizhixing()

